Optimal. Leaf size=209 \[ \frac {5 a^4 (A-B-2 C) \sin (c+d x)}{2 d}+\frac {a^4 (8 A+13 B+12 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {(3 A+18 B+22 C) \sin (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{6 d}+\frac {1}{2} a^4 x (13 A+8 B+2 C)-\frac {(A-B-2 C) \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{2 d}-\frac {a (3 A-2 C) \sin (c+d x) (a \sec (c+d x)+a)^3}{6 d}+\frac {A \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^4}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.57, antiderivative size = 209, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 4, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.098, Rules used = {4086, 4018, 3996, 3770} \[ \frac {5 a^4 (A-B-2 C) \sin (c+d x)}{2 d}+\frac {a^4 (8 A+13 B+12 C) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {(A-B-2 C) \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{2 d}+\frac {(3 A+18 B+22 C) \sin (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{6 d}+\frac {1}{2} a^4 x (13 A+8 B+2 C)-\frac {a (3 A-2 C) \sin (c+d x) (a \sec (c+d x)+a)^3}{6 d}+\frac {A \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^4}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3770
Rule 3996
Rule 4018
Rule 4086
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos (c+d x) (a+a \sec (c+d x))^4 \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x))^4 (2 a (2 A+B)-a (3 A-2 C) \sec (c+d x)) \, dx}{2 a}\\ &=-\frac {a (3 A-2 C) (a+a \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^4 \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x))^3 \left (a^2 (15 A+6 B-2 C)-6 a^2 (A-B-2 C) \sec (c+d x)\right ) \, dx}{6 a}\\ &=-\frac {a (3 A-2 C) (a+a \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^4 \sin (c+d x)}{2 d}-\frac {(A-B-2 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x))^2 \left (2 a^3 (18 A+3 B-8 C)+2 a^3 (3 A+18 B+22 C) \sec (c+d x)\right ) \, dx}{12 a}\\ &=-\frac {a (3 A-2 C) (a+a \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^4 \sin (c+d x)}{2 d}-\frac {(A-B-2 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(3 A+18 B+22 C) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{6 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x)) \left (30 a^4 (A-B-2 C)+6 a^4 (8 A+13 B+12 C) \sec (c+d x)\right ) \, dx}{12 a}\\ &=\frac {5 a^4 (A-B-2 C) \sin (c+d x)}{2 d}-\frac {a (3 A-2 C) (a+a \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^4 \sin (c+d x)}{2 d}-\frac {(A-B-2 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(3 A+18 B+22 C) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{6 d}-\frac {\int \left (-6 a^5 (13 A+8 B+2 C)-6 a^5 (8 A+13 B+12 C) \sec (c+d x)\right ) \, dx}{12 a}\\ &=\frac {1}{2} a^4 (13 A+8 B+2 C) x+\frac {5 a^4 (A-B-2 C) \sin (c+d x)}{2 d}-\frac {a (3 A-2 C) (a+a \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^4 \sin (c+d x)}{2 d}-\frac {(A-B-2 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(3 A+18 B+22 C) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{6 d}+\frac {1}{2} \left (a^4 (8 A+13 B+12 C)\right ) \int \sec (c+d x) \, dx\\ &=\frac {1}{2} a^4 (13 A+8 B+2 C) x+\frac {a^4 (8 A+13 B+12 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {5 a^4 (A-B-2 C) \sin (c+d x)}{2 d}-\frac {a (3 A-2 C) (a+a \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^4 \sin (c+d x)}{2 d}-\frac {(A-B-2 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(3 A+18 B+22 C) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 4.64, size = 524, normalized size = 2.51 \[ \frac {a^4 (\cos (c+d x)+1)^4 \sec ^8\left (\frac {1}{2} (c+d x)\right ) \sec ^3(c+d x) \left (A \cos ^2(c+d x)+B \cos (c+d x)+C\right ) \left (\sec (c) (36 d x (13 A+8 B+2 C) \cos (2 c+d x)+36 d x (13 A+8 B+2 C) \cos (d x)-42 A \sin (2 c+d x)+96 A \sin (c+2 d x)+96 A \sin (3 c+2 d x)+57 A \sin (2 c+3 d x)+9 A \sin (4 c+3 d x)+48 A \sin (3 c+4 d x)+48 A \sin (5 c+4 d x)+3 A \sin (4 c+5 d x)+3 A \sin (6 c+5 d x)+156 A d x \cos (2 c+3 d x)+156 A d x \cos (4 c+3 d x)+102 A \sin (d x)-192 B \sin (2 c+d x)+48 B \sin (c+2 d x)+48 B \sin (3 c+2 d x)+192 B \sin (2 c+3 d x)+12 B \sin (3 c+4 d x)+12 B \sin (5 c+4 d x)+96 B d x \cos (2 c+3 d x)+96 B d x \cos (4 c+3 d x)+384 B \sin (d x)-288 C \sin (2 c+d x)+96 C \sin (c+2 d x)+96 C \sin (3 c+2 d x)+320 C \sin (2 c+3 d x)+24 C d x \cos (2 c+3 d x)+24 C d x \cos (4 c+3 d x)+672 C \sin (d x))-96 (8 A+13 B+12 C) \cos ^3(c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )\right )}{1536 d (A \cos (2 (c+d x))+A+2 B \cos (c+d x)+2 C)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 191, normalized size = 0.91 \[ \frac {6 \, {\left (13 \, A + 8 \, B + 2 \, C\right )} a^{4} d x \cos \left (d x + c\right )^{3} + 3 \, {\left (8 \, A + 13 \, B + 12 \, C\right )} a^{4} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (8 \, A + 13 \, B + 12 \, C\right )} a^{4} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (3 \, A a^{4} \cos \left (d x + c\right )^{4} + 6 \, {\left (4 \, A + B\right )} a^{4} \cos \left (d x + c\right )^{3} + 2 \, {\left (3 \, A + 12 \, B + 20 \, C\right )} a^{4} \cos \left (d x + c\right )^{2} + 3 \, {\left (B + 4 \, C\right )} a^{4} \cos \left (d x + c\right ) + 2 \, C a^{4}\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.40, size = 347, normalized size = 1.66 \[ \frac {3 \, {\left (13 \, A a^{4} + 8 \, B a^{4} + 2 \, C a^{4}\right )} {\left (d x + c\right )} + 3 \, {\left (8 \, A a^{4} + 13 \, B a^{4} + 12 \, C a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (8 \, A a^{4} + 13 \, B a^{4} + 12 \, C a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {6 \, {\left (7 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}} - \frac {2 \, {\left (6 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 21 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 30 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 48 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 76 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 27 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 54 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.66, size = 279, normalized size = 1.33 \[ \frac {A \,a^{4} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}+\frac {13 A \,a^{4} x}{2}+\frac {13 A \,a^{4} c}{2 d}+\frac {a^{4} B \sin \left (d x +c \right )}{d}+a^{4} C x +\frac {C \,a^{4} c}{d}+\frac {4 A \,a^{4} \sin \left (d x +c \right )}{d}+4 a^{4} B x +\frac {4 a^{4} B c}{d}+\frac {6 a^{4} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {13 a^{4} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {20 a^{4} C \tan \left (d x +c \right )}{3 d}+\frac {4 A \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {4 a^{4} B \tan \left (d x +c \right )}{d}+\frac {2 a^{4} C \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}+\frac {A \,a^{4} \tan \left (d x +c \right )}{d}+\frac {a^{4} B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a^{4} C \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.36, size = 320, normalized size = 1.53 \[ \frac {3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{4} + 72 \, {\left (d x + c\right )} A a^{4} + 48 \, {\left (d x + c\right )} B a^{4} + 4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{4} + 12 \, {\left (d x + c\right )} C a^{4} - 3 \, B a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, C a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 24 \, A a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 36 \, B a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 24 \, C a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a^{4} \sin \left (d x + c\right ) + 12 \, B a^{4} \sin \left (d x + c\right ) + 12 \, A a^{4} \tan \left (d x + c\right ) + 48 \, B a^{4} \tan \left (d x + c\right ) + 72 \, C a^{4} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.06, size = 625, normalized size = 2.99 \[ \frac {3\,A\,a^4\,\sin \left (2\,c+2\,d\,x\right )+\frac {33\,A\,a^4\,\sin \left (3\,c+3\,d\,x\right )}{32}+\frac {3\,A\,a^4\,\sin \left (4\,c+4\,d\,x\right )}{2}+\frac {3\,A\,a^4\,\sin \left (5\,c+5\,d\,x\right )}{32}+\frac {3\,B\,a^4\,\sin \left (2\,c+2\,d\,x\right )}{2}+3\,B\,a^4\,\sin \left (3\,c+3\,d\,x\right )+\frac {3\,B\,a^4\,\sin \left (4\,c+4\,d\,x\right )}{8}+3\,C\,a^4\,\sin \left (2\,c+2\,d\,x\right )+5\,C\,a^4\,\sin \left (3\,c+3\,d\,x\right )+\frac {15\,A\,a^4\,\sin \left (c+d\,x\right )}{16}+3\,B\,a^4\,\sin \left (c+d\,x\right )+6\,C\,a^4\,\sin \left (c+d\,x\right )+\frac {117\,A\,a^4\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4}+18\,A\,a^4\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+18\,B\,a^4\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {117\,B\,a^4\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4}+\frac {9\,C\,a^4\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+27\,C\,a^4\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {39\,A\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{4}+6\,A\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )+6\,B\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )+\frac {39\,B\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{4}+\frac {3\,C\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+9\,C\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{3\,d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________